from google.appengine.ext import db

class Tag(db.Model):
	text = db.StringProperty()
	value = db.IntegerProperty(default=1)

	def responses(self):
		return (x.response for x in self.connection_set)

def getTag(text):
	text = text.lower()
	query = Tag.gql("WHERE text = :1", text)
	tag = query.get()
	if not tag:
		tag = Tag()
		tag.text = text
		tag.put()
	return tag


